﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using TiaoTaoHelper.Wtm.Models;
using WalkingTec.Mvvm.Core;

namespace HengTong.Model.Db.Hr.Bill;

/// <summary>
/// 员工调岗调薪申请表
/// </summary>
[Display(Name = "调岗调薪", Description = "员工调岗调薪申请表单", GroupName = "人事业务表单")]
public class SysHrTransferRequestBill : BaseBill
{
    [Required]
    [Display(Name = "员工ID", Description = "关联员工主键", GroupName = "单据信息")]
    public Guid? PersonId { get; set; }

    [Display(Name = "员工", Description = "关联的员工实体", GroupName = "单据信息")]
    public SysPerson Person { get; set; }

    [Display(Name = "员工工号", Description = "员工工号", GroupName = "续签信息")]
    [StringLength(128)]
    public string StaffNo { get; set; }

    [Display(Name = "员工姓名", Description = "员工姓名", GroupName = "续签信息")]
    [StringLength(128)]
    public string Name { get; set; }
    
    [Display(Name = "申请日期", Description = "申请日期", GroupName = "单据信息")]
    public DateTime? ApplyDate { get; set; }

    [Display(Name = "生效日期", Description = "变更生效日期", GroupName = "单据信息")]
    public DateTime? EffectiveDate { get; set; }

    // 调整类型
    [Display(Name = "调整类型", Description = "调整类型", GroupName = "调整类型")]
    public TransferType? TransferType { get; set; }

    // 原职位信息
    [Display(Name = "原部门", Description = "原部门", GroupName = "工作信息")]
    public SysGroup OriginalGroup { get; set; }

    [Display(Name = "原部门", Description = "原部门", GroupName = "工作信息")]
    public Guid? OriginalGroupId { get; set; }
    
    [Display(Name = "原岗位", Description = "原岗位", GroupName = "工作信息")]
    public SysJobPosition OriginalPosition { get; set; }

    [Display(Name = "原岗位", Description = "原岗位", GroupName = "工作信息")]
    public Guid? OriginalPositionId { get; set; }


    [Display(Name = "原职级", Description = "原职级", GroupName = "原职位信息")]
    [StringLength(128)]
    public string OriginalRank { get; set; }

    [Display(Name = "原基本薪资", Description = "原基本薪资", GroupName = "原职位信息")]
    [Column(TypeName = "decimal(10,2)")]
    public decimal? OriginalBaseSalary { get; set; }

    [Display(Name = "原岗位薪资", Description = "原岗位薪资", GroupName = "原职位信息")]
    [Column(TypeName = "decimal(10,2)")]
    public decimal? OriginalPositionSalary { get; set; }

    [Display(Name = "原绩效薪资", Description = "原绩效薪资", GroupName = "原职位信息")]
    [Column(TypeName = "decimal(10,2)")]
    public decimal? OriginalPerformanceSalary { get; set; }

    // 调整后信息
    [Display(Name = "新部门", Description = "新部门", GroupName = "调整后信息")]
    public SysGroup NewGroup { get; set; }

    [Display(Name = "新部门", Description = "新部门", GroupName = "调整后信息")]
    public Guid? NewGroupId { get; set; }

    [Display(Name = "新岗位", Description = "新岗位", GroupName = "调整后信息")]
    public SysJobPosition NewPosition { get; set; }

    [Display(Name = "新岗位", Description = "新岗位", GroupName = "调整后信息")]
    public Guid? NewPositionId { get; set; }


    [Display(Name = "新职级", Description = "新职级", GroupName = "调整后信息")]
    [StringLength(128)]
    public string NewRank { get; set; }

    [Display(Name = "新基本薪资", Description = "新基本薪资", GroupName = "调整后信息")]
    [Column(TypeName = "decimal(10,2)")]
    public decimal? NewBaseSalary { get; set; }

    [Display(Name = "新岗位薪资", Description = "新岗位薪资", GroupName = "调整后信息")]
    [Column(TypeName = "decimal(10,2)")]
    public decimal? NewPositionSalary { get; set; }

    [Display(Name = "新绩效薪资", Description = "新绩效薪资", GroupName = "调整后信息")]
    [Column(TypeName = "decimal(10,2)")]
    public decimal? NewPerformanceSalary { get; set; }

    [Display(Name = "调整原因", Description = "调整原因", GroupName = "调整后信息")]
    [StringLength(512)]
    public string TransferReason { get; set; }
    
    [Display(Name = "证明文件ID", Description = "调岗调薪相关的证明材料ID", GroupName = "附件信息")]
    public Guid? SupportingDocumentId { get; set; }

    [Display(Name = "证明文件", Description = "调岗调薪相关的证明材料", GroupName = "附件信息")]
    public FileAttachment SupportingDocument { get; set; }
}